import { createFeatureSelector, createSelector,  } from '@ngrx/store';
import { RouterReducerState } from '@ngrx/router-store';
import { RouterStateUrl } from '../reducers';
/**
 * get router state
 */
export const getRouterStateSelector = createFeatureSelector<RouterReducerState<RouterStateUrl>>('routerReducer');

export const getRouterStateNavigationIdSelector = createSelector(
    getRouterStateSelector, 
    (state: RouterReducerState<RouterStateUrl>) => state.navigationId
);

export const getRouterStateUrlSelector = createSelector(
    getRouterStateSelector, 
    (state: RouterReducerState<RouterStateUrl>) => state.state
);

export const getBreadcrumbSelector = createSelector(getRouterStateUrlSelector, (state: RouterStateUrl) => state.breadcrumb);